<template>
	<view>
		<view class="left">
			<text>用户名:{{user.name}}</text><br>
			<text>权限:{{user.name}}</text>
			<button @click="ProductGoods">作品管理</button>
			<button @click="culture">传统文化</button>
			<button @click="Order">订单管理</button>
			<button @click="series">系列管理</button>
			<button @click="announ">公告管理</button>
			<button @click="outlogin">退出登录</button>
			<text>{{year}}</text><br>
			<text>{{time}} </text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "manage",
		data() {
			return {
				user: {
					name: '未登录',
				},
				time: null,
				intervalTimer: null,
				year: "",
			};
		},
		props: {
			fontColor: {
				type: String,
				default: '#666666'
			},
			fontSize: {
				type: String,
				default: '32rpx'
			},
			fontWeight: {
				type: Number,
				default: 700
			}
		},
		computed: {},
		watch: {},
		mounted() {
			this.getTime();
			this.intervalTimer = setInterval(this.getTime, 1000);
		},
		destroyed() {
			clearInterval(this.intervalTimer);
		},
		methods: {
			video(){
				uni.navigateTo({
					url:"/pages/video/video"
				})
			},

			announ(){
				uni.navigateTo({
					url:"/pages/announ/announ"
				})
			},
			series(){
				uni.navigateTo({
					url:"/pages/series/series"
				})
			},
			picture(){
				uni.navigateTo({
					url: "/pages/announ/announ"
				})
			},
			series() {
				uni.navigateTo({
					url: "/pages/seriesManage/seriesManage"
				})
			},
			picture() {
				uni.navigateTo({
					url: "/pages/picture/picture"
				})
			},
			culture() {
				uni.navigateTo({
					url: "/pages/culture/culture"
				})
			},
			Order() {
				uni.navigateTo({
					url: "/pages/OrderforGoods/OrderforGoods",
				})
			},
			ProductGoods() {
				uni.navigateTo({
					url: "/pages/ProductGoods/ProductGoods",

				})
			},
			uers() {
				uni.navigateTo({
					url: "/pages/Uers/Uers",

				})
			},
			good() {
				uni.navigateTo({
					url: "/pages/commodity/commodity"
				})
			},
			getTime() {
				let date = new Date();
				let hours = date.getHours();
				let minutes = date.getMinutes();
				let seconds = date.getSeconds();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				hours = hours < 10 ? `0${hours}` : hours;
				minutes = minutes < 10 ? `0${minutes}` : minutes;
				seconds = seconds < 10 ? `0${seconds}` : seconds;
				month >= 1 && month <= 9 ? (month = "0" + month) : "";
				day >= 0 && day <= 9 ? (day = "0" + day) : "";
				this.time = `${hours}:${minutes}:${seconds}`;
				this.year = year + '-' + month + '-' + day;
			},
		},
	}
</script>

<style>
	text{
		color: #ffffff;
	}
	.left {
		align-items: center;
		width: 100%;
		background-color: #2b4b6b;
		/* float: left; */
	}

	button {
		margin-top: 20px;
		margin-bottom: 20px;
		width: 100%;
		font-size: 6px;
	}

	text {
		margin-top: 10px;
		margin-bottom: 10px;
		/* width: 100px; */
		font-size: 18px;
	}
</style>
